﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HttpContrib;
using Microsoft.Http;
using TMShopClient.Interface;

namespace Question {
    public class QuestionController : IMediaTypeController {
        private readonly IShell _Shell;
        private QuestionContent _Content;


        public QuestionController(IShell shell) {
            _Shell = shell;
        }

        public void Handle(HttpResponseMessage response) {
            _Content = new QuestionContent(response.Content);

            var view = new QuestionView();
            view.SetText(_Content.AsText());
            _Shell.ShowView(view);
    
        }

        public void Deactivate() {
           // throw new NotImplementedException();
        }

        public void ReturnFromChild(object returnValue) {
            throw new NotImplementedException();
        }

        public IHypermediaContent Content {
            get { return _Content; }
        }
    }
}
